import java.util.*;

public class code3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),k = in.nextInt();
        long[] a = new long[n+1];
        long[] b = new long[n+1];
        for(int i=1;i<n+1;i++) a[i]=in.nextLong();
        for(int i=1;i<n+1;i++) b[i]=in.nextLong();

        int left=1,right=1;
        long hSum=0,sSum=0,hMax=0,sMin=0,begin=0;
        while(right<=n) {
            //进窗口
            hSum += a[right];
            sSum += b[right];
            //出窗口
            while(right-left+1>k) {
                hSum -= a[left];
                sSum -= b[left];
                left++;
            }
            //更新结果
            if(right-left+1==k) {
                if(hSum>hMax) {
                    begin=left;
                    hMax=hSum;
                    sMin=sSum;
                } else if(hSum==hMax && sSum<sMin) {
                    begin = left;
                    sMin = sSum;
                }
            }
            right++;
        }
        System.out.print(begin);
    }
}